package vip.liux.backend.application.service.files.dtos;

import jakarta.annotation.Nullable;
import lombok.Data;
import vip.liux.contracts.shared.value.LevelModel;

import java.util.List;


@Data
public class DirectoryDescriptorInfoDto implements LevelModel<DirectoryDescriptorInfoDto> {

    private Long id;
    private String name;
    private @Nullable Long parentId;
    private boolean hasChildren;
    private List<DirectoryDescriptorInfoDto> children;

    public DirectoryDescriptorInfoDto() {
    }

    public DirectoryDescriptorInfoDto(Long id, String name, @Nullable Long parentId, boolean hasChildren) {
        this.id = id;
        this.name = name;
        this.parentId = parentId;
        this.hasChildren = hasChildren;
    }

    @Override
    public List<DirectoryDescriptorInfoDto> getChildren() {
        return children;
    }

    @Override
    public void setChildren(List<DirectoryDescriptorInfoDto> children) {
        this.children = children;
    }
}
